package com.democxy.modules.cms.api;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Component;

import com.democxy.common.baseData.ResponeData;
import com.democxy.common.enums.ResultEnum;
import com.democxy.modules.cms.entity.AdHref;
import com.democxy.modules.cms.entity.BlogType;
import com.democxy.modules.cms.entity.Blogs;
import com.github.pagehelper.PageInfo;

import feign.hystrix.FallbackFactory;

@Component 
public class ArticleServiceFallbackFactory  implements FallbackFactory<ArticleService> {

	@Override
	public ArticleService create(Throwable cause) {
		// TODO Auto-generated method stub
		return new ArticleService() {
			
			@Override
			public ResponeData<PageInfo<BlogType>> typeList(BlogType blogType) {
				// TODO Auto-generated method stub
				System.out.println("服务出错处理。");
				return new ResponeData<PageInfo<BlogType>>(ResultEnum.FAILED,null);
			}
			
			@Override
			public ResponeData<PageInfo<Blogs>> list(Blogs blogs) {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public ResponeData<Blogs> getById(String id) {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public ResponeData<List<Blogs>> getBlogs(Integer pageSize, String orderBy) {
				return new ResponeData<List<Blogs>>(ResultEnum.FAILED,null);
			}
			
			@Override
			public ResponeData<Blogs> getAdById(String id) {
				// TODO Auto-generated method stub
				return null;
			}
			
			@Override
			public ResponeData<PageInfo<AdHref>> adList(AdHref adHref) {
				// TODO Auto-generated method stub
				return null;
			}
		};
	}

}
